N = 1 (slider from 1 to 15, step 1)
f(x) = If[(-π) < x < π, x]
g(x) = If[π < x < (3 * π), x - (2 * π)]
h(x) = If[(-3 * π) < x < (-π), x + (2 * π)]
S = Sum((((2 * (-1)^(n + 1))) / n * sin((n * x))), n, 1, N)
p(x) = If[-9.42477796076938 < x < 9.42477796076938, S]